<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Login</title>
    <link rel="shortcut icon" th:href="@{/img/favicon.jpg}" type="image/x-icon">
    <script type="text/javascript" th:src="@{/layUI/layui.all.js}"></script>
    <script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
    <style>
        .form {
            display: flex;
            justify-content: center;
        }
    </style>
</head>
<body>
<div class="form">
    <form action="sys/login" method="post">
        account: <input type="text" id="account" name="account">
        <br><br>
        password: <input type="password" id="password" name="password">
        <br><br>
        <input type="button" id="submit" value="submit">
    </form>
</div>
<script>
    $(function () {
        $("#index").click(function () {
            window.location.href = "/sys/index";
        });
        $("#submit").click(function () {
            var account = $("#account").val();
            var password = $("#password").val();
            $.post("/sys/login", {
                account: account,
                password: password
            }, function (data) {
                if (data.status !== 200) {
                    return false;
                } else {
                    window.location.href = "/pearIndex";
                }
            });
        });
    });
</script>
</body>
</html>